package rad.framework.jboss;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Vector;

import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
import org.jboss.ha.framework.interfaces.DistributedState;
import org.jboss.ha.framework.interfaces.HAPartition;

@SuppressWarnings("unchecked")
public class MockPartition implements HAPartition {

	public void callAsynchMethodOnCluster(String arg0, String arg1,
			Object[] arg2, boolean arg3) throws Exception {
	}

	public void callAsynchMethodOnCluster(String arg0, String arg1,
			Object[] arg2, Class[] arg3, boolean arg4) throws Exception {
	}

	public ArrayList callMethodOnCluster(String arg0, String arg1,
			Object[] arg2, boolean arg3) throws Exception {
		return null;
	}

	public ArrayList callMethodOnCluster(String arg0, String arg1,
			Object[] arg2, Class[] arg3, boolean arg4) throws Exception {
		return null;
	}

	public ArrayList callMethodOnCoordinatorNode(String arg0, String arg1,
			Object[] arg2, Class[] arg3, boolean arg4) throws Exception {
		return null;
	}

	public boolean getAllowSynchronousMembershipNotifications() {
		return false;
	}

	public ClusterNode getClusterNode() {
		return null;
	}

	public ClusterNode[] getClusterNodes() {
		return null;
	}

	public Vector getCurrentView() {
		return null;
	}

	public long getCurrentViewId() {
		return 0;
	}

	public DistributedReplicantManager getDistributedReplicantManager() {
		return new MockDistributedReplicantManager();
	}

	public DistributedState getDistributedStateService() {
		return null;
	}

	public String getNodeName() {
		return null;
	}

	public String getPartitionName() {
		return null;
	}

	public void registerMembershipListener(HAMembershipListener arg0) {
	}

	public void registerRPCHandler(String arg0, Object arg1) {
	}

	public void setAllowSynchronousMembershipNotifications(boolean arg0) {
	}

	public void subscribeToStateTransferEvents(String arg0,
			HAPartitionStateTransfer arg1) {
	}

	public void unregisterMembershipListener(HAMembershipListener arg0) {
	}

	public void unregisterRPCHandler(String arg0, Object arg1) {
	}

	public void unsubscribeFromStateTransferEvents(String arg0,
			HAPartitionStateTransfer arg1) {
	}

	public class MockDistributedReplicantManager implements
			DistributedReplicantManager {

		public void add(String arg0, Serializable arg1) throws Exception {
		}

		public Collection getAllServices() {
			return null;
		}

		public int getReplicantsViewId(String arg0) {
			return 0;
		}

		public boolean isMasterReplica(String arg0) {
			return false;
		}

		public Serializable lookupLocalReplicant(String arg0) {
			return null;
		}

		public List lookupReplicants(String arg0) {
			return null;
		}

		public List lookupReplicantsNodeNames(String arg0) {
			return null;
		}

		public void registerListener(String arg0, ReplicantListener arg1) {
		}

		public void remove(String arg0) throws Exception {
		}

		public void unregisterListener(String arg0, ReplicantListener arg1) {
		}
	}
}
